package com.yuju.hotel.enums;
/**
 * 
 * 类名：FlOORReturnCodeEnum  <br />
 *
 * 功能：楼层业务代码枚举
 *
 * @author : zhousc <br />
 * @Date : 2017年11月27日 上午9:57:27  <br />
 * @version : 1.1 <br />
 */
public enum FloorReturnCodeEnum {
	FLOOR_QUERY_SUCCESS("yuju-floor-1000", "楼层查询成功"),
	FLOOR_QUERY_FAILURE("yuju-floor-1001", "楼层查询失败"),
	FLOOR_SAVE_SUCCESS("yuju-floor-1002", "楼层保存成功"),
	FLOOR_SAVE_FAILURE("yuju-floor-1003", "楼层保存失败"),
	FLOOR_UPDATE_SUCCESS("yuju-floor-1004", "楼层更新成功"),
	FLOOR_UPDATE_FAILURE("yuju-floor-1005", "楼层更新失败"),
	FLOOR_DEL_SUCCESS("yuju-floor-1006", "楼层删除成功"),
	FLOOR_DEL_FAILURE("yuju-floor-1007", "楼层下有房间，删除失败"),
	FLOOR_VALID_SUCCESS("yuju-floor-1008", "校检成功"),
	FLOOR_VALID_FAILURE("yuju-floor-1009", "校检失败");
	
	private String code;
	private String desc;
	
	FloorReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (FloorReturnCodeEnum enume : FloorReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}